package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ShoppingCartMapper {

    ShoppingCart findSameshoppingCart(ShoppingCart shoppingCart);

    int updateShoppingCart(ShoppingCart shoppingCart);

    int insertShoppingCart(ShoppingCart shoppingCart);


    int delete(ShoppingCart dbShoppingCart);

    @Select("select * from shopping_cart where user_id = #{userId}")
    List<ShoppingCart> findShoppingCartByUserId(Long userId);

    @Delete("delete from shopping_cart where user_id = #{userId}")
    int cleanShoppingCart(Long userId);
}

